home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-05-01 | 8.9 KB | 260 lines | [TEXT/MPS ] |
- /*
- File: CodeFragments.idl
-
- Contains: Public Code Fragment Manager Interfaces.
-
- Version: Technology: System 7 and System 8
- Release: Universal Interfaces 3.0d3 on Copland DR1
-
- Copyright: © 1984-1996 by Apple Computer, Inc. All rights reserved.
-
- Bugs?: If you find a problem with this file, send the file and version
- information (from above) and the problem description to:
-
- Internet: apple.bugs@applelink.apple.com
- AppleLink: APPLE.BUGS
-
- */
- /*
- •
- ===========================================================================================
- The Code Fragment Manager API
- =============================
- */
- #ifndef __CODEFRAGMENTS_IDL__
- #define __CODEFRAGMENTS_IDL__
-
- #include <somobj.idl>
- #include <somcls.idl>
-
- #ifndef __TYPES_IDL__
- #include <Types.idl>
- #endif
- #ifndef __FILES_IDL__
- #include <Files.idl>
- #endif
- #if FOR_SYSTEM8_PREEMPTIVE
- #ifndef __KERNEL_IDL__
- #include <Kernel.idl>
- #endif
- #ifndef __FILEMANAGERTYPES_IDL__
- #include <FileManagerTypes.idl>
- #endif
- #ifndef __TEXTOBJECTS_IDL__
- #include <TextObjects.idl>
- #endif
- #endif
-
- #ifdef __SOMIDL__
-
- /*
- §
- ===========================================================================================
- Universal types and constants
- =============================
- */
- #if FOR_SYSTEM7_AND_SYSTEM8_PREEMPTIVE
- /*
- ----------------------------------------------------------------------------
- These declarations are for System 7 and all System 8 execution environments.
- */
- typedef OSType CFragArchitecture;
-
- #if GENERATINGPOWERPC
- #endif
- #if GENERATING68K
- #endif
- typedef UInt32 CFragVersionNumber;
-
- typedef UInt8 CFragUsage;
-
- typedef UInt8 CFragLocatorKind;
-
- /*
- --------------------------------------------------------------------------------------
- A 'cfrg' resource consists of a header followed by a sequence of variable length
- members. The constant kDefaultCFragNameLen only provides for a legal ANSI declaration
- and for a reasonable display in a debugger. The actual name field is cut to fit.
- There may be "extensions" after the name, the memberSize field includes them. The
- general form of an extension is a 16 bit type code followed by a 16 bit size in bytes.
- Only one standard extension type is defined at present, it is used by SOM's searching
- mechanism.
- */
- typedef SOMFourByteStruct CFragUsage1Union; /* Derived from a struct of 4 bytes in size */
-
- typedef SOMTwoByteStruct CFragUsage2Union; /* Derived from a struct of 2 bytes in size */
-
- typedef SOMLargeStruct CFragWhere1Union; /* Derived from a struct of 8 bytes in size */
-
- typedef SOMTwoByteStruct CFragWhere2Union; /* Derived from a struct of 2 bytes in size */
-
- typedef SOMLargeStruct CFragResourceMember; /* Derived from a struct of 58 bytes in size */
-
- typedef OpaquePtr CFragResourceMemberPtr; /* Substituted OpaquePtr for “CFragResourceMember*” */
-
- typedef SOMFourByteStruct CFragResourceExtensionHeader; /* Derived from a struct of 4 bytes in size */
-
- typedef OpaquePtr CFragResourceExtensionHeaderPtr; /* Substituted OpaquePtr for “CFragResourceExtensionHeader*” */
-
- typedef SOMLargeStruct CFragResourceSearchExtension; /* Derived from a struct of 9 bytes in size */
-
- typedef OpaquePtr CFragResourceSearchExtensionPtr; /* Substituted OpaquePtr for “CFragResourceSearchExtension*” */
-
- typedef SOMLargeStruct CFragResource; /* Derived from a struct of 90 bytes in size */
-
- typedef OpaquePtr CFragResourcePtr; /* Substituted OpaquePtr for “CFragResource*” */
-
- typedef OpaquePtr CFragConnectionID;
-
- typedef OpaquePtr CFragClosureID;
-
- typedef OpaquePtr CFragContainerID;
-
- typedef OpaquePtr CFragContextID;
-
- typedef UInt32 CFragLoadOptions;
-
- typedef UInt8 CFragSymbolClass;
-
- #endif
- /*
- §
- ===========================================================================================
- System 7 Services (Deprecated in System 8)
- ==========================================
- */
- #if FOR_SYSTEM7_AND_SYSTEM8_DEPRECATED
- /*
- ---------------------------------------------------------------------------------
- These declarations are for System 7 and the System 8 cooperative environment, but
- should be avoided under System 8. Better alternatives exist for System 8.
- */
- #endif
- /*
- §
- ===========================================================================================
- System 8 Services (Not available in System 7)
- =============================================
- */
- #if FOR_SYSTEM8_PREEMPTIVE
- /*
- ---------------------------------------------------------------------------------
- These declarations are for all System 8 execution environments, but not System 7.
- */
- typedef SOMLargeStruct CFragRegisteredFileInfo; /* Derived from a struct of 12 bytes in size */
-
- typedef UInt8 CFragCompatibility;
-
- typedef UInt32 CFragShortVersionPair;
-
- #endif
- /*
- §
- ===========================================================================================
- Initialization & Termination Routines
- =====================================
- -----------------------------------------------------------------------------------------
- A fragment's initialization and termination routines are called when a new incarnation of
- the fragment is created or destroyed, respectively. Exactly when this occurs depends on
- what kinds of section sharing the fragment has and how the fragment is prepared. Import
- libraries have at most one incarnation per process. Fragments prepared with option
- kPrivateCFragCopy may have many incarnations per process.
- The initialization function is passed a pointer to an initialization information structure
- and returns an OSErr. If an initialization function returns a non-zero value the entire
- closure of which it is a part fails. The CFragInitBlock type has different visible parts
- under System 7 and System 8, but is of course the same internally. The C prototype for an
- initialization function is:
- pascal OSErr CFragInitFunction ( const CFragInitBlock * initBlock );
- The termination procedure takes no parameters and returns nothing. The C prototype for a
- termination procedure is:
- pascal void CFragTermProcedure ( void );
- */
- #if FOR_OPAQUE_SYSTEM_DATA_STRUCTURES
- /*
- --------------------------------------------------------------------------------------
- These declarations are the preferred form for System 8, hiding implementation details.
- */
- typedef SOMLargeStruct CFragOpaqueInitBlock; /* Derived from a struct of 44 bytes in size */
-
- typedef OpaquePtr CFragOpaqueInitBlockPtr; /* Substituted OpaquePtr for “CFragOpaqueInitBlock*” */
-
- typedef CFragOpaqueInitBlock CFragInitBlock;
-
- typedef CFragOpaqueInitBlockPtr CFragInitBlockPtr;
-
- #else
- /*
- --------------------------------------------------------------------------------------
- These declarations are for System 7. They may be used in System 8 but expose details.
- */
- typedef SOMLargeStruct CFragSystem7MemoryLocator; /* Derived from a struct of 12 bytes in size */
-
- typedef SOMLargeStruct CFragSystem7DiskFlatLocator; /* Derived from a struct of 12 bytes in size */
-
- /* ! This must have a file specification at the same offset as a disk flat locator!*/
- typedef SOMLargeStruct CFragSystem7SegmentedLocator; /* Derived from a struct of 12 bytes in size */
-
- typedef SOMLargeStruct CFragSystem7Locator; /* Derived from a struct of 40 bytes in size */
-
- typedef OpaquePtr CFragSystem7LocatorPtr; /* Substituted OpaquePtr for “CFragSystem7Locator*” */
-
- typedef SOMLargeStruct CFragSystem7InitBlock; /* Derived from a struct of 36 bytes in size */
-
- typedef OpaquePtr CFragSystem7InitBlockPtr; /* Substituted OpaquePtr for “CFragSystem7InitBlock*” */
-
- typedef CFragSystem7InitBlock CFragInitBlock;
-
- typedef CFragSystem7InitBlockPtr CFragInitBlockPtr;
-
- #endif
- typedef OpaquePtr CFragInitFunction;
- typedef OpaquePtr CFragTermProcedure;
- /*
- §
- ===========================================================================================
- Old Name Spellings
- ==================
- -------------------------------------------------------------------------------------------
- We've tried to reduce the risk of name collisions in the future by introducing the phrase
- "CFrag" into constant and type names. The old names are defined below in terms of the new.
- */
- #if OLDROUTINENAMES
- typedef CFragConnectionID ConnectionID;
-
- typedef CFragLoadOptions LoadFlags;
-
- typedef CFragSymbolClass SymClass;
-
- typedef CFragInitBlock InitBlock;
-
- typedef CFragInitBlockPtr InitBlockPtr;
-
- #if !FOR_OPAQUE_SYSTEM_DATA_STRUCTURES
- typedef CFragSystem7MemoryLocator MemFragment;
-
- typedef CFragSystem7DiskFlatLocator DiskFragment;
-
- typedef CFragSystem7SegmentedLocator SegmentedFragment;
-
- typedef CFragSystem7Locator FragmentLocator;
-
- typedef CFragSystem7LocatorPtr FragmentLocatorPtr;
-
- typedef CFragSystem7MemoryLocator CFragHFSMemoryLocator;
-
- typedef CFragSystem7DiskFlatLocator CFragHFSDiskFlatLocator;
-
- typedef CFragSystem7SegmentedLocator CFragHFSSegmentedLocator;
-
- typedef CFragSystem7Locator CFragHFSLocator;
-
- typedef CFragSystem7LocatorPtr CFragHFSLocatorPtr;
-
- #endif
- #endif
-
- #endif /* __SOMIDL__ */
-
- #endif /* __CODEFRAGMENTS_IDL__ */
-
-